package com.twu.biblioteca.model.users;

/**
 * Created with IntelliJ IDEA.
 * User: cschlumb
 * Date: 12/08/2013
 * Time: 14:52
 * To change this template use File | Settings | File Templates.
 */
public class UserFormatter {

    private final StringBuilder stringBuilder = new StringBuilder();

    public void add(User user){
        stringBuilder.append("Username: ");
        stringBuilder.append(user.getUsername());
        stringBuilder.append('\n');
        stringBuilder.append("Name: ");
        stringBuilder.append(user.getName());
        stringBuilder.append('\n');
        stringBuilder.append("Email: ");
        stringBuilder.append(user.getEmail());
        stringBuilder.append('\n');
        stringBuilder.append("Phone: ");
        stringBuilder.append(user.getPhone());
    }

    public String toFormattedString(){
        return stringBuilder.toString();
    }
}
